/*
day302 
2020.6.25 
*/
#include<vector>
#include<iostream>
using namespace std;


class Solution {
public:
    int distanceBetweenBusStops(vector<int>& distance, int start, int destination) {
		int sum=0;
		for(int i=0;i<distance.size();++i)
		{
			sum+=distance[i];
		}
		
		if(start>destination)
		{
			int tem=start;
			start=destination;
			destination=tem;
		}
		
		int route=0;
		for(int i=start;i<destination;++i)
		{
			route+= distance[i];
		}
		
		return min(route,sum-route);
    }
};

int main()
{
	return 0;
}

